package com.it.chatgptchen.controller;


import com.it.chatgptchen.domain.ProStateManagement;
import com.it.chatgptchen.domain.common.AjaxResultBox;
import com.it.chatgptchen.service.IProProgressService;
import org.apache.shiro.web.util.RedirectView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

/**
 * chatGpt Ai Controller
 *
 * @author
 * @date 2023-04-24
 */
@Controller
public class ProProgressController{

    private String prefix = "pack";

    @Autowired
    private IProProgressService iProProgressService;

    @RequestMapping("/")
    public String index() {
        return prefix + "/index";
    }

    @GetMapping("pack/indexS")
    public String newPage() {
        return prefix + "/indexS";
    }

    /**
     * 人工对话
     */
    @CrossOrigin(origins = "*")
    @PostMapping("pack/progress/list")
    @ResponseBody
    public AjaxResultBox completions(@RequestBody ProStateManagement proStateManagement)
    {
        return iProProgressService.sseChat(proStateManagement);
    }

}
